package wudtcalc.gaskets;

import java.io.Serializable;
import wudtcalc.DataContainer;

/**
 *
 * @author Jadalbert
 */
public class Gasket implements Serializable{
    DataContainer dc;
    
    private double du;
    private double u;
    private double ucz;
    
    public Gasket() {};
    
    public Gasket(DataContainer dc_) {
        dc = dc_;
    };
    
    public String Du() {
        return "Du = (dz+dw)/2 = ";
    }

    /**
     * @return the du
     */
    public double getDu() {
        return 0.5 * (dc.getDz() + dc.getDw());
    }

    /**
     * @return the u
     */
    public double getU() {
        return 0.5 * (dc.getDz() - dc.getDw());
    }

    /**
     * @return the ucz
     */
    public double getUcz() {
        if (getU() < 12.0) {
            return getU();
        }    
        else {
            return 3.47 * Math.sqrt(getU());
        }
    }
}